<template>
  <div class="search">
    <van-search
      @search="onSearch"
      v-model="searchValue"
      placeholder="请输入搜索关键词"
    />
  </div>
</template>

<script lang="js">
import {defineComponent, reactive, ref} from 'vue'

export default defineComponent({
  props: {

  },
  components: {

  },
  emits:['searchChange'],
  setup(props,{emit}) {
    const searchValue=ref('')
    const onSearch=(value)=>{
      emit('searchChange',value)
      console.log(value);
    }
    return {
      searchValue,
      onSearch
    }

  }
})
</script>

<style scoped lang="less">
.search {
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  .van-search {
    padding: 0 !important;
  }
}
</style>
